<?php

/**
 * This is the model class for table "jumlahpelangganlistrik".
 *
 * The followings are the available columns in table 'jumlahpelangganlistrik':
 * @property integer $jpl_id
 * @property integer $jpl_tahun
 * @property integer $jpl_rumah_tangga
 * @property integer $jpl_usaha
 * @property integer $jpl_instansi
 * @property integer $jpl_ibadah
 * @property integer $jpl_industri
 * @property integer $jpl_hotel
 * @property integer $jpl_penerangan
 */
class Jumlahpelangganlistrik extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahpelangganlistrik the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahpelangganlistrik';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jpl_tahun, jpl_rumah_tangga, jpl_usaha, jpl_instansi, jpl_ibadah, jpl_industri, jpl_hotel, jpl_penerangan', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jpl_id, jpl_tahun, jpl_rumah_tangga, jpl_usaha, jpl_instansi, jpl_ibadah, jpl_industri, jpl_hotel, jpl_penerangan', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jpl_id' => 'Jpl',
			'jpl_tahun' => 'Tahun',
			'jpl_rumah_tangga' => 'Rumah Tangga',
			'jpl_usaha' => 'Usaha',
			'jpl_instansi' => 'Instansi',
			'jpl_ibadah' => 'Ibadah',
			'jpl_industri' => 'Industri',
			'jpl_hotel' => 'Hotel',
			'jpl_penerangan' => 'Penerangan',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jpl_id',$this->jpl_id);
		$criteria->compare('jpl_tahun',$this->jpl_tahun);
		$criteria->compare('jpl_rumah_tangga',$this->jpl_rumah_tangga);
		$criteria->compare('jpl_usaha',$this->jpl_usaha);
		$criteria->compare('jpl_instansi',$this->jpl_instansi);
		$criteria->compare('jpl_ibadah',$this->jpl_ibadah);
		$criteria->compare('jpl_industri',$this->jpl_industri);
		$criteria->compare('jpl_hotel',$this->jpl_hotel);
		$criteria->compare('jpl_penerangan',$this->jpl_penerangan);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}